import { Navigate } from "react-router-dom";
import cookie from 'js-cookie';

const AuthRoute = ({children}:any) => {
    const token = cookie.get('token');
    if(!token) return <Navigate to="/login" />
    return <>{children}</>;
}

export default AuthRoute;